package org.dut.aoptest.Proxy;

public class HouseProxy implements HouseSubject {
    RealHouseSubject realHouseSubject;

    public HouseProxy(RealHouseSubject realHouseSubject) {
        this.realHouseSubject = realHouseSubject;
    }
    @Override
    public void rentHouse() {
        System.out.println("我是中介，开始代理");
        realHouseSubject.rentHouse();
        System.out.println("我是中介，结束代理");
    }

    @Override
    public void saleHouse() {
        System.out.println("我是中介，开始代理");
        realHouseSubject.saleHouse();
        System.out.println("我是中介，结束代理");
    }
}
